ParcelCompat

Helper for accessing features in Parcel.

Functions

Link copied to clipboard
open fun <T> readArray(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>): @Nullable Array<Any>
Same as readArray but accepts clazz parameter as the type required for each item.
Link copied to clipboard
open fun <T> readArrayList(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<out T>): @Nullable ArrayList<T>
Same as readArrayList but accepts clazz parameter as the type required for each item.
Link copied to clipboard
open fun readBoolean(@NonNull in: @NonNull Parcel): Boolean
Read a boolean value from the parcel at the current dataPosition.
Link copied to clipboard
open fun <K, V> readHashMap(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazzKey: @NonNull Class<out K>, @NonNull clazzValue: @NonNull Class<out V>): @Nullable HashMap<K, V>
Same as readHashMap but accepts clazzKey and clazzValue parameter as the types required for each key and value pair.
Link copied to clipboard
open fun <T> readList(@NonNull in: @NonNull Parcel, @NonNull outVal: @NonNull List<in T>, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>)
Same as readList but accepts clazz parameter as the type required for each item.
Link copied to clipboard
open fun <K, V> readMap(@NonNull in: @NonNull Parcel, @NonNull outVal: @NonNull Map<in K, in V>, @Nullable loader: @Nullable ClassLoader, @NonNull clazzKey: @NonNull Class<K>, @NonNull clazzValue: @NonNull Class<V>)
Same as readMap but accepts clazzKey and clazzValue parameter as the types required for each key and value pair.
Link copied to clipboard
open fun <T : Parcelable?> readParcelable(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>): @Nullable T
Same as readParcelable but accepts clazz parameter as the type required for each item.
Link copied to clipboard
open fun <T> readParcelableArray(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>): @Nullable Array<T>
Same as readParcelableArray but accepts clazz parameter as the type required for each item.
Link copied to clipboard
open fun <T> readParcelableArrayTyped(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>): @Nullable Array<Parcelable>
Same as readParcelableArray but accepts clazz parameter as the type required for each item.
Link copied to clipboard
@RequiresApi(value = 30)
open fun <T> readParcelableCreator(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>): @Nullable Parcelable.Creator<T>
Same as readParcelableCreator but accepts clazz parameter as the required type.
Link copied to clipboard
open fun <T> readParcelableList(@NonNull in: @NonNull Parcel, @NonNull list: @NonNull List<T>, @Nullable cl: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>): @NonNull List<T>
Same as readParcelableList but accepts clazz parameter as the type required for each item.
Link copied to clipboard
open fun <T : Serializable?> readSerializable(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<T>): @Nullable T
Same as readSerializable but accepts loader parameter as the primary classLoader for resolving the Serializable class; and clazz parameter as the required type.
Link copied to clipboard
open fun <T> readSparseArray(@NonNull in: @NonNull Parcel, @Nullable loader: @Nullable ClassLoader, @NonNull clazz: @NonNull Class<out T>): @Nullable SparseArray<T>
Same as readSparseArray but accepts clazz parameter as the type required for each item.
Link copied to clipboard
open fun writeBoolean(@NonNull out: @NonNull Parcel, value: Boolean)
Write a boolean value into the parcel at the current fdataPosition, growing dataCapacity if needed.